const {
  addUser,
  getUserById,
  getUserByName,
  loginUser,
  deleteUser,
  updateUser,
} = require('./userServices')
const { addNotice, getAllNotice } = require('./constructionNoticeServices')
const {
  addReport,
  getReportById,
  getReport,
  updateReportStatus,
} = require('./roadConditionReportServices')

async function test() {
  /* // 测试添加用户
  const res = await addUser({
    username: 'common2',
    password: '123456789',
  }) */
  /* // 测试根据id查找用户
  const res = await getUserById(5) */
  /* // 测试根据用户名模糊查找用户
  const res = await getUserByName('common') */
  /* // 测试用户登录
  const res = await loginUser('test-common', 'asdfghjkl') */
  /* // 测试删除用户
  const res = await deleteUser(2) */
  /* // 测试更新用户
  const res = await updateUser(5, {
    username: 'miaomiao1',
    password: '1234567890',
    type: 'traffic',
    isOnline: true,
  }) */

  /* // 测试新增公告
  const res = await addNotice({
    // 发布时间为执行函数的时间，即现在
    publishContent: '测试公告3',
  }) */
  /* // 测试获取所有公告
  const res = await getAllNotice() */

  /* // 测试新增路况报告
  const res = await addReport({
    reportByWho: '小红',
    eventType: '其他',
    eventAddress: '测试路口',
    nearbyBuilding: '测试楼栋',
    occurrenceTime: new Date(),
    eventDescription: '测试路况',
    eventPhoto: 'https://picsum.photos/id/1/200/200',
    auditStatus: 'rejected',
  })
 */
  /* // 测试更新路况报告审核状态
  const res = await updateReportStatus(1, 'approved') */

  console.log('res:', res)
}

test()
